UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eKGcO/5cXXiYdtjmQb9WfpUHHDaCcX3Vc3lik8l0RPc='
WHERE
key_id = 'e45bae681e4ffafc96654c4fd2b307a25d2b7cf5f361c3997fe5f1142221e062'
AND (
token = 'eKGcO/5cXXiYdtjmQb9WfpUHHDaCcX3Vc3lik8l0RPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)