UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qds0iu2/j1qCNbPRZl8r3WOrBHeNbpF3YSPgU9oB6xk=' 
WHERE 
  key_id = '42232a8896563ca008c1d4a74265a677a50a861a1373feb4fc852df7e9316a18' 
  AND (
    token = 'qds0iu2/j1qCNbPRZl8r3WOrBHeNbpF3YSPgU9oB6xk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023