UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xrz8Mb03cyAVuY/bbBciSKXtvXYyt8RCmtiGhLQO88w=' 
WHERE 
  key_id = '14cdea995b4f76efe3af14b1a2943f88549f759ca85ec59149b1b00f7bb421e4' 
  AND (
    token = 'xrz8Mb03cyAVuY/bbBciSKXtvXYyt8RCmtiGhLQO88w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039