UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FSbGFXpvbDfnF0yfEso7pGmlN7ahtJZKc3Xhr36T6TU='
WHERE
key_id = 'c75f1d048288b5b373fea2f4ace4a93c3783b9695730c862dab7ae97451c6985'
AND (
token = 'FSbGFXpvbDfnF0yfEso7pGmlN7ahtJZKc3Xhr36T6TU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)