UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kmvVkA0q09YlzcH/FFPUQNqcjbcqTJs6FOfLdArfE8I='
WHERE
key_id = '04b6d1ba011abb01993dc97183b60ad7bfe3558b53a379abaa45c65d1e53fdd4'
AND (
token = 'kmvVkA0q09YlzcH/FFPUQNqcjbcqTJs6FOfLdArfE8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)