UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oiL49CvIneffI1Gsm4KKaRNLQTzslGpYZmOllgrkmmU='
WHERE
key_id = '232feec6021b636b351489c824af44de616f17864f81a3e9e5488728de39dd23'
AND (
token = 'oiL49CvIneffI1Gsm4KKaRNLQTzslGpYZmOllgrkmmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)