UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IAcSIR9VPJCicr/rUOIsAdGV7+N3Pf6BFQaxdzVn+Cw=' 
WHERE 
  key_id = '07a2f466b102d1ddd89ede13737f3677e8f0858419fb3d13e4efb13cdffb50cb' 
  AND (
    token = 'IAcSIR9VPJCicr/rUOIsAdGV7+N3Pf6BFQaxdzVn+Cw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023