UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DE1d0Bn/vImU8n8jSRdwG4Qrlfssiov4HzRU2DWEZFI='
WHERE
key_id = '2ce2dbef72058af2576c272275528f33f26e12f5ca1e7e46b033471e8aaad2e6'
AND (
token = 'DE1d0Bn/vImU8n8jSRdwG4Qrlfssiov4HzRU2DWEZFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)