UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V9VIiTapmWZRpDHrbWkaIV8ZHC3DU2G7WwOPITG3X7U='
WHERE
key_id = '5c336d5a48f2dfbf7c4cd720607187c2532ecdc371cba1f290dd92ae8d87f91c'
AND (
token = 'V9VIiTapmWZRpDHrbWkaIV8ZHC3DU2G7WwOPITG3X7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)