UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wcAOsFgLe/G3nn/ccu38ygM+SUuml8m5rH58Z51bXgg='
WHERE
key_id = 'e37295a51a8b39834a9a8ba3ae7075942b3bfea09867104ab0197977bf006b78'
AND (
token = 'wcAOsFgLe/G3nn/ccu38ygM+SUuml8m5rH58Z51bXgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)