UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y2dvpy25V38ySGzQMYVUS73BZYTWMvKtSwGe/AfPdDo=' 
WHERE 
  key_id = 'bdb4e4a2fd341dce2814007f5f3d59804373ad69e7bb359a816c5abfebb15894' 
  AND (
    token = 'y2dvpy25V38ySGzQMYVUS73BZYTWMvKtSwGe/AfPdDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030