UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ph4ujozOquCDf0qatPfr1K8/nM8QDRKnUV847JKbkvY='
WHERE
key_id = 'b98f67f45e5d1531cdf64b83019cf4a1b165b26c9ac8aa2fd139f4804ab9a974'
AND (
token = 'ph4ujozOquCDf0qatPfr1K8/nM8QDRKnUV847JKbkvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)