UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qjFqUKQysePinPzf2/PmO8XlxCf07IODD7tvfHPeX3M='
WHERE
key_id = '0c68b8c54e517bf73ca22f9e54c5e10d7fe26275a48192c681e523a2fbba43fd'
AND (
token = 'qjFqUKQysePinPzf2/PmO8XlxCf07IODD7tvfHPeX3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)