UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i1zzWIKWv78sjsmXXk81USV6DWX17KKjFAeMMnSeE/4=' 
WHERE 
  key_id = '942d0bad679793d0bfcc1e95fe0f6a67b96b998e1a155432fd6c95e59776266d' 
  AND (
    token = 'i1zzWIKWv78sjsmXXk81USV6DWX17KKjFAeMMnSeE/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026