UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBt7p3CRAiu6Z+4PHEdkVOGOBfMlsh8bEPEM6M7Tzms='
WHERE
key_id = 'bdc1227414effbd4465c1bfbb5467d0f2bb99872c38bff4c969b8952eeb8ff23'
AND (
token = 'uBt7p3CRAiu6Z+4PHEdkVOGOBfMlsh8bEPEM6M7Tzms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)