UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tmUFeCTlhuy/2zftX1kvfgvf3+bvrFN9zWUJVFLiJws='
WHERE
key_id = '11482821f8f285b9790fff5c2f89d911f5e74e7ab9399ebe37664fac2aabe41b'
AND (
token = 'tmUFeCTlhuy/2zftX1kvfgvf3+bvrFN9zWUJVFLiJws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)