UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IJft1AuWkOGcQADqT0OdKpIQnM1AjIR7drAYb4XmBls='
WHERE
key_id = '5844c0a0876b84fd8359f7155fc30db4b563d951bf5720d8a59dd4f31b546369'
AND (
token = 'IJft1AuWkOGcQADqT0OdKpIQnM1AjIR7drAYb4XmBls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)