UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4+iSaZ0my5vtAKW1MPQw5rZFtKQE7K8Pz1DYi4O+6qU='
WHERE
key_id = '5c029cb271386c61295ccdec258c5e5aefbd1263bd4e8aaa542c9b8d94661b6e'
AND (
token = '4+iSaZ0my5vtAKW1MPQw5rZFtKQE7K8Pz1DYi4O+6qU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)