UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HCUqNE4xKde3ritEH1806XB85XRgackked59qHxu77c=' 
WHERE 
  key_id = 'df2ba44b4b809c0e0134a251057fb4034b6dfe7a46d4ebea72b055c67c827f03' 
  AND (
    token = 'HCUqNE4xKde3ritEH1806XB85XRgackked59qHxu77c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059