UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qWu2D+7AZbhj23CMmNaxRI+0d8C6U+/KqJj4BsGtXpg='
WHERE
key_id = '880fee0251c2dcd02edfa1e09c54964d2895c9b37e9f6df8227af7edc9014de7'
AND (
token = 'qWu2D+7AZbhj23CMmNaxRI+0d8C6U+/KqJj4BsGtXpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)