UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6nniFJwvLy3tI17dhIi5YjXcSzy3ldRK+YiY2fBefVg=' 
WHERE 
  key_id = 'cb29d0d6384ca3abe88fe709bb2afdcb77ebbf2d10c268dca8f04210509ce987' 
  AND (
    token = '6nniFJwvLy3tI17dhIi5YjXcSzy3ldRK+YiY2fBefVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036