UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qWGj4hEckS2jS3v/DxpxgB5lLFEOO4XnyF7xQEVQQTo='
WHERE
key_id = '456840c277f3893d846742dcdea2272f3a56748fdc54199de87cad91736d60cb'
AND (
token = 'qWGj4hEckS2jS3v/DxpxgB5lLFEOO4XnyF7xQEVQQTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)