UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4s9VvEeP3TujtaE6n1QUCrxa7rvicsSepH20Oc9BRWc=' 
WHERE 
  key_id = '03b011574355fc51e30756c45a2f4706be1c0ea7c32cc2f6efce1db565a29167' 
  AND (
    token = '4s9VvEeP3TujtaE6n1QUCrxa7rvicsSepH20Oc9BRWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033