UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3g7dD+0n/eDI403/wAiix8qQ6rNTcrQ7LncxMN1LIt8='
WHERE
key_id = 'a1893b3f233e308c5347072c091d2bfba0426c01ee2fd8144d13cbe180daf6be'
AND (
token = '3g7dD+0n/eDI403/wAiix8qQ6rNTcrQ7LncxMN1LIt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)