UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jStogfp1Z7s8QqscSZvng0Ra+jzdHMUn7J8LY372o4E='
WHERE
key_id = '0912082715cc34f35d5be03c221be520e612d00c6dd426f4d34159984b4f065e'
AND (
token = 'jStogfp1Z7s8QqscSZvng0Ra+jzdHMUn7J8LY372o4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)