UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dbPjFowg7xfbKNu05i8+5kww/RqSgh7kICpUoHqg3hY=' 
WHERE 
  key_id = 'c99317df9b82a1eff1894fbd5051f26f00f9b866b9fada286a59fe00bd2cd4d2' 
  AND (
    token = 'dbPjFowg7xfbKNu05i8+5kww/RqSgh7kICpUoHqg3hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024