UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fW1S11mCaQtgNRsxIS7V4dxUg+UxkdzZqFmU7lMqFlo='
WHERE
key_id = 'd28570f4abb9e7c0f9f105eb5bb40b43bd2d9c3eeaa491d2e2fc0b1344bf855b'
AND (
token = 'fW1S11mCaQtgNRsxIS7V4dxUg+UxkdzZqFmU7lMqFlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)