UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YMNMp9qeuW/Ls0tHTNdmwbXsuENO43e0gHnlg1AeUpk='
WHERE
key_id = '2a03b4e8d4a9aaa5402005d762f8d6859700acb5b9e97c125bae3e8fccbe26d7'
AND (
token = 'YMNMp9qeuW/Ls0tHTNdmwbXsuENO43e0gHnlg1AeUpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)