UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6ERMgIkxk/XFk+YI0LoUeNTPZOLwCAxQFWEqrM6Xqs='
WHERE
key_id = '80fd384a132080d203727eb9f338a608594210b9133cc8a72e20d2ddffb6cb87'
AND (
token = 'p6ERMgIkxk/XFk+YI0LoUeNTPZOLwCAxQFWEqrM6Xqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)