UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZ1bil322YN/t0OFG1NaCHCehk0jB04paIwLb44gKeM='
WHERE
key_id = '527c685912b0cde47c73c79790a52cb0a37370dcab0e2bd05ac4544113651b25'
AND (
token = 'yZ1bil322YN/t0OFG1NaCHCehk0jB04paIwLb44gKeM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)