UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+MO6yKvhnOwVu4tatEwRvy27vGpE3q0yQkX2PH5VIkE=' 
WHERE 
  key_id = '9b007a79169f3278c6ae98b141301b14bb0e47b6b595447a53d518dc96233a08' 
  AND (
    token = '+MO6yKvhnOwVu4tatEwRvy27vGpE3q0yQkX2PH5VIkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042