UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hndGAmsHhU63JFnoUrLK2CFwLDFSq7mLVtS7/oxJDiA='
WHERE
key_id = '8bbd04f7eee0c9be157a751ac964985d9b613ea38766f9d580dbe0fd189bf255'
AND (
token = 'hndGAmsHhU63JFnoUrLK2CFwLDFSq7mLVtS7/oxJDiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)