UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PHOUYwWolvKz2lRhUkKawz0ht4tIrdK8PXiUmyjB1fc='
WHERE
key_id = '0550600419e784b52f40a50ededc78ece5eaac71f24bf3c706e2e80ae785811b'
AND (
token = 'PHOUYwWolvKz2lRhUkKawz0ht4tIrdK8PXiUmyjB1fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)