UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wh6/RqTV49lBFo0xZNu32nXIxRbaOXoA7qvXVZ0WIyw='
WHERE
key_id = '27a450575c916201998de1a5e8763c97ebe67c381ee0fc2bc8f7d9fb6b5b52e5'
AND (
token = 'Wh6/RqTV49lBFo0xZNu32nXIxRbaOXoA7qvXVZ0WIyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)